unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Options2, Options, ComCtrls, ToolWin, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    Options1: TOptions;
    Options21: TOptions2;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure ToolButton1Click(Sender: TObject);
    procedure ToolButton2Click(Sender: TObject);
    procedure ToolButton3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  IniOBox: TIniOBox;
  Option: Options2.TOption;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Options1.SaveAllOptions;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Options1.LoadAllOptions;
end;

procedure TForm1.ToolButton1Click(Sender: TObject);
begin
  Option.Value := Edit1.Text;
  Option.Apply;
  IniOBox.SaveOption(Option);
end;

procedure TForm1.ToolButton2Click(Sender: TObject);
begin
  IniOBox := TIniOBox.Create;
  IniOBox.FileName := 'c:\IniOBox.ini';
  Option := Options2.TOption.Create(nil);
  Option.Section := 'IniOBox Section';
  Option.Ident := 'IniOBox Ident';
end;

procedure TForm1.ToolButton3Click(Sender: TObject);
begin
  IniOBox.LoadOption(Option);
  Edit1.Text := Option.Value;
end;

end.
